package top.jolyoulu.mytomcat;

/**
 * @Author LuZhouJin
 * @Date 2023/8/4
 * 一个简单的Servlet实现
 */
public abstract class MyServlet {

    public void service(MyRequest request, MyResponse response) throws Exception {
        //判断不同的请求类型调用不懂的方法
        if ("GET".equalsIgnoreCase(request.getMethod())) {
            doGet(request, response);

        } else {
            doPost(request, response);
        }
    }

    public abstract void doPost(MyRequest request, MyResponse response) throws Exception;

    public abstract void doGet(MyRequest request, MyResponse response) throws Exception;

}
